package md.mru.core.dtos;

import java.io.Serializable;

/**
 * @author sergiu.marin
 * @since 23.04.2014.
 */
public class TreeUserGroupIdDto implements Serializable {

    private static final long serialVersionUID = 9171638681252239329L;

    private TreeNodeModelDto treeNodeModel;
    private UserGroupDto userGroup;

    public TreeUserGroupIdDto() {
        super();
    }

    public TreeUserGroupIdDto(TreeNodeModelDto treeNodeModel, UserGroupDto userGroup) {
        this.treeNodeModel = treeNodeModel;
        this.userGroup = userGroup;
    }

    public TreeNodeModelDto getTreeNodeModel() {
        return treeNodeModel;
    }

    public void setTreeNodeModel(TreeNodeModelDto treeNodeModel) {
        this.treeNodeModel = treeNodeModel;
    }

    public UserGroupDto getUserGroup() {
        return userGroup;
    }

    public void setUserGroup(UserGroupDto userGroup) {
        this.userGroup = userGroup;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TreeUserGroupIdDto that = (TreeUserGroupIdDto) o;

        return !(treeNodeModel != null ? !treeNodeModel.equals(that.treeNodeModel) : that.treeNodeModel != null) && !(userGroup != null ? !userGroup.equals(that.userGroup) : that.userGroup != null);

    }

    @Override
    public int hashCode() {
        int result = treeNodeModel != null ? treeNodeModel.hashCode() : 0;
        result = 31 * result + (userGroup != null ? userGroup.hashCode() : 0);
        return result;
    }
}
